function e(e, t, a) {
  return t in e ? Object.defineProperty(e, t, {
    value: a,
    enumerable: !0,
    configurable: !0,
    writable: !0
  }) : e[t] = a, e;
}
let app = getApp();
// let compose = require('../../utils/compose');
var util = require('../../../utils/util.js');
var applet_park_api_url = app.globalData.applet_park_api_url;
var applet_park_api_url_imgUrl = app.globalData.applet_park_api_url_imgUrl;

const {
  requestDataparams
} = require('../../../utils/request.js');

function t(e) {
  return parseInt(e) < 10 && (e = "0" + e), e;
}

var a, s = require("../../../utils/calendar.js"),
  n = getApp();
Page({
  data: (a = {
      currenttab: '0',
      imgUrl: applet_park_api_url_imgUrl,
      squareImg: applet_park_api_url_imgUrl + '/duihao.png',
      orderlists: [],
      type: '',
      items: [],
      showModal: false,
      currentDate: '',
      currentWeek: '',
      firstId: '',
      beginTime: '',
      endTime: '',
      selectedId: [],
      selectedTime: [],
      newselectedId: [],
      isContine: 'true',
      checkIcon: false,
      roomPrice: 0,
      totalPrice: 0,
      meetingEndTime: '',
      meetingStartTime: '',
      firstTime: true,
      firstCheckId: '',
      isOverdue: true,
      date: '',
      currentDate1: '',
      currentWeek1: '',
    }, e(a, "errorMessage", ""), e(a, "checkMessage", !1), e(a, "dialogDate", !1), e(a, "nowDateIndex", wx.getStorageSync("nowDateIndex")),
    e(a, "topDate", wx.getStorageSync("topDate")), e(a, "date_data1", []), e(a, "date_data2", []),
    e(a, "date_now", {
      month: "",
      year: "",
      value: ""
    }), e(a, "date_next", {
      month: "",
      year: "",
      value: ""
    }), e(a, "add_btn", !0), e(a, "reduce_btn", !1), e(a, "final_num", 1), e(a, "show_a", !1),
    e(a, "selecedList", []), e(a, "saleStatus", "nothing"), e(a, "saleContent", {}),
    e(a, "imgUrl", n.globalData.KrImgUrl), e(a, "cardStatus", "nothing"), e(a, "cardLength", 0),
    e(a, "discount", !1), e(a, "originalAmount", 0), a),

  go: function() {
    this.setData({
      showModal: false,
    })
    this.cleanRenewal();
  },
  cleanRenewal() { //清除续约选中的数据
    var that = this;
    var TimeList = that.data.rangeTime;
    for (var i = 0; i < TimeList.length; i++) {
      var TimeItem = TimeList[i];
      TimeList[i][0].activity = true;
    }
    var arrar = that.data.selectedId;
    arrar = arrar.concat(TimeList[0][0].timeId);
    var array1 = that.data.selectedTime;
    array1 = array1.concat(TimeList[0][0].time);
    var price = parseInt(that.data.roomPrice) / 2;
    that.handleTimeSection(array1);
    that.setData({
      selectedId: [],
      rangeTime: [],
      firstId: '',
      selectedTime: [],
      totalPrice: 0,
    })
  },
  getNowRangeTime: function() {
    var e = this.data.detailInfo.meetingRoomId,
      t = this,
      a = [],
      n = [];
    wx.showLoading({
      title: "加载中"
    });
    var i = new Date(),
      s = 2 * i.getHours() + 1 + (i.getMinutes() > 29 ? 1 : 0),
      r = this.data.selectedTime;
    o.getRequest({
      url: o.globalData.KrUrl + "api/gateway/krmting/room/disableTime",
      methods: "GET",
      data: {
        date: t.data.orderDate.time,
        meetingRoomId: e
      },
      header: {
        "content-type": "appication/json"
      },
      success: function(e) {
        a = e.data.data.disableTime;
        for (var i = 19; i < 49; i++) {
          var o = {
            disabled: !1,
            number: i,
            actived: !1
          };
          n.push(o);
        }
        n.forEach(function(e, n) {
          a.indexOf(e.number) > -1 && (e.disabled = !0), "今天" == t.data.orderDate.timeText && e.number < s && (e.disabled = !0),
            r.indexOf(e.number) > -1 && (e.actived = !0);
        }), t.setData({
          rangeTime1: n.slice(0, 8),
          rangeTime2: n.slice(8, 16),
          rangeTime3: n.slice(16, 24),
          rangeTime4: n.slice(24),
          rangeTime: n
        }, function() {
          wx.hideLoading();
        });
      }
    });
  },
  getThemeName: function(e) {
    var t = e.time.split("-"),
      a = "" + t[1] + t[2] + "会议";
    this.setData({
      orderDate: e,
      themeName: a
    }), this.choose_date = e.time;
  },
  dealDateList: function() {
    var e = this.data.nowDate,
      t = this.data.topDate,
      a = "";
    t.map(function(t) {
      t.date === e && (a = t.type);
    });
    var n = this;
    n.james = new i.dateData({
      btn_bool: !0,
      data: t,
      init_data: {
        last_btn_num: e,
        last_data: a
      }
    }), this.setData({
      date_data1: n.james.date_data1,
      date_data2: n.james.date_data2
    });
  },
  dateBtn: function(e) {
    this.james.dateBtn(e);
    var t = this.james.getValue();
    this.setData({
      date_data1: this.date_data1,
      date_data2: this.date_data2,
      selecedList: t
    });
  },
  onLoad: function() {
    var that = this;
    that.loadDatameetingorderlist();
    that.getNowDate();
  },
  getNowDate() { //获取当前时间
    var that = this;
    var date = new Date();
    var seperator1 = "-";
    var seperator2 = ":";
    var month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
    var strDate = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
    var getHours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
    var getMinutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
    var getSeconds = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
    var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate +
      " " + getHours + seperator2 + getMinutes +
      seperator2 + getSeconds;
    var weekArr = ['星期天', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
    var week = weekArr[date.getDay()];
    that.setData({
      currentDate: currentdate.substring(0, 10),
      currentWeek: week,
      date: currentdate
    })
  },
  getTime(data, conferenceRoomId, startTime, endTime, roomPrice) { //获取会议室续约时间
    var that = this;
    wx.request({
      url: applet_park_api_url + '/api/conferenceRooms/scheduleTime',
      method: 'GET',
      data: {
        renewal: true,
        id: conferenceRoomId,
        day: data,
        renewalDate: data + ' ' + endTime + ':00',
      },
      success(res) {
        if (res.data.code == 0) {
          that.setData({
            showModal: true,
          })
          var timeList = res.data.data;
          var result = [];
          for (var i = 0; i < timeList.length; i += 8) {
            result.push(timeList.slice(i, i + 8));
          }
          that.setData({
            rangeTime: result,
            rowLength: result.length
          })
          //that.firstJudgeTime();//获取已经选中的时间id
          that.judgeFirst(result) //设置默认第一个时间区间选中
        } else { //
          that.setData({
            showModal: false,
          })
          wx.showToast({
            title: '该订单不可续约',
          })
        }


      },
      fail(res) {
        wx.showToast({
          title: res.data,
        })
      }
    })

  },
  tapTime: function(e) { //选择时间
    var that = this;
    var nowIdArray = [];
    var nowTimeArray = [];
    var newnowIdArray = [];
    var checkId = e.currentTarget.dataset.index;
    var checkTime = e.currentTarget.dataset.time;
    var timeState = e.currentTarget.dataset.state;
    var checkIdArray = that.data.selectedId; //被选中时间的id
    var newcheckIdArray = that.data.selectedId; //当前被选中的时间id
    var selectedTimeArray = that.data.selectedTime;
    newnowIdArray = that.data.selectedId;
    if (!timeState) { //时间已经选过了
      wx.showToast({
        title: '时间已选择,请选择其时间',
        icon: 'none'
      })
      return false
    }
    if (checkIdArray.length > 0) {
      nowIdArray = nowIdArray.sort();
      newnowIdArray = newnowIdArray.sort();
      var index = checkIdArray.indexOf(checkId);
      var lastNum = checkIdArray[checkIdArray.length - 1];
      if (index >= 0) { //存在
        if (that.data.firstId == checkId) {
          wx.showToast({
            title: '续约时间需连续',
          })
          return false;
        }
        var nowContinue = that.isContinuityNum(newcheckIdArray); //返回是否连续
        if (nowContinue == true) {
          if (lastNum == checkId) {
            that.judgeIcon(checkId, false);
            checkIdArray.splice(index, 1);
            newcheckIdArray.splice(index, 1);
            newcheckIdArray.splice(index, 1);
            selectedTimeArray.splice(index, 1);
            that.setData({
              selectedId: checkIdArray,
              newselectedId: newcheckIdArray,
              selectedTime: selectedTimeArray,
            })
          } else {
            wx: wx.showToast({
              title: '请选择连续的时间',
              icon: 'none',
              duration: 1000,
            })
          }
        }
      } else { //不存在
        nowIdArray = checkIdArray.concat(checkId);
        newcheckIdArray = newcheckIdArray.concat(checkId);
        selectedTimeArray = selectedTimeArray.concat(checkTime);
        var nowContinue = that.isContinuityNum(nowIdArray); //返回是否连续
        if (nowContinue == true) {
          checkIdArray = nowIdArray;
          that.judgeIcon(checkId, true);
          that.setData({
            selectedId: checkIdArray,
            newselectedId: newcheckIdArray,
            selectedTime: selectedTimeArray,
          })
        } else {
          wx: wx.showToast({
            title: '请选择连续的时间',
            icon: 'none',
            duration: 1000,
          })
        }
      }
    } else {
      checkIdArray = checkIdArray.concat(checkId);
      newcheckIdArray = newcheckIdArray.concat(checkId);
      selectedTimeArray = selectedTimeArray.concat(checkTime);
      that.judgeIcon(checkId, true);
      that.setData({
        selectedId: checkIdArray,
        newselectedId: newcheckIdArray,
        selectedTime: selectedTimeArray,
      })
    }
    that.setData({
      selectedTime: selectedTimeArray
    })
    //判断时间区间  先找出开始时间和结束时间
    if (that.data.selectedTime.length != 0) {
      that.handleTimeSection(that.data.selectedTime);
    } else {
      that.setData({
        totalPrice: 0,
      })
    }
  },
  getFirstTime() {
    var that = this;
    var rangeTime = that.data.rangeTime; //所有的时间数据
    var checkIdArray1 = [];
    for (var i = 0; i < rangeTime.length; i++) {
      var rangeTimeList = rangeTime[i];
      for (var j = 0; j < rangeTimeList.length; j++) {
        if (rangeTimeList[j].state == false) { //时间已选择后的 放到数组中
          checkIdArray1.push(rangeTimeList[j].timeId)
        }
      }
    }
    //checkIdArray1 = checkIdArray1.concat(checkId);
    this.setData({
      selectedTime: checkIdArray1
    })
  },
  firstJudgeTime() { //第一次判断
    var that = this;
    var rangeTime = that.data.rangeTime; //所有的时间数据
    var checkIdArray1 = [];
    for (var i = 0; i < rangeTime.length; i++) {
      var rangeTimeList = rangeTime[i];
      for (var j = 0; j < rangeTimeList.length; j++) {
        if (rangeTimeList[j].state == false) { //时间已选择后的 放到数组中
          checkIdArray1.push(rangeTimeList[j].timeId)
        }
      }
    }
  },
  judgeIcon(checkId, iconState) {
    var that = this;
    var TimeList = that.data.rangeTime;
    for (var i = 0; i < TimeList.length; i++) {
      var TimeItem = TimeList[i];
      for (var j = 0; j < TimeItem.length; j++) {
        if (checkId == TimeItem[j].timeId) {
          TimeItem[j].activity = iconState;
        }
      }
    }
    that.setData({
      rangeTime: TimeList
    })
  },
  judgeFirst(result) { //第一个时间区间必须选中才能保证时间连续
    var that = this;
    var TimeList = result;
    TimeList[0][0].activity = true;
    var arrar = that.data.selectedId;
    arrar = arrar.concat(TimeList[0][0].timeId);
    var array1 = that.data.selectedTime;
    array1 = array1.concat(TimeList[0][0].time);
    that.handleTimeSection(array1);
    that.setData({
      selectedId: arrar,
      rangeTime: TimeList,
      firstId: TimeList[0][0].timeId,
      selectedTime: array1,
    })
  },
  isContinuityNum(num) { //判断是时间否连续
    var that = this;
    var number = that.handArray(num);
    num = number
    let array = [];
    if (num instanceof Array) {
      array = [...num];
    } else {
      array = Array.from(num.toString()) //转换为数组
    }
    var i = array[0];
    var isContinuation = true;
    for (var e in array) {
      if (array[e] != i) {
        isContinuation = false;
        break;
      }
      i++;
    }
    return isContinuation;
  },
  handArray(num) {
    var number = [];
    for (var i = 0; i < num.length; i++) { //字符串数组转数字
      number = number.concat(parseInt(num[i]));
    }
    //数组按照从小到大排序
    var tmp = 0;
    for (var i = 0; i < number.length; i++) {
      for (var j = 0; j < number.length - i - 1; j++) {
        if (number[j] > number[j + 1]) {
          tmp = number[j + 1];
          number[j + 1] = number[j];
          number[j] = tmp;
        }
      }
    }
    return number
  },
  judgeRepeat(checkTime, selectedTimeArray) { //判断选中的日期是否存在
    var that = this;
    for (var i = 0; i < selectedTimeArray.length; i++) {
      var index = selectedTimeArray.indexOf(checkTime);
      if (index > -1) {
        selectedTimeArray.splice(index, 1); //存在就删除
      } else {
        that.setData({
          selectedTime: selectedTimeArray.concat(checkTime),
        })
      }
    }
  },
  handleTimeSection(section) { //先找出开始时间和结束时间
    var that = this;
    var maxTime = ''; //最大的时间
    var minTime = ''; //初始时间
    var newSection = [];
    for (var i = 0; i < section.length; i++) {
      newSection = newSection.concat(that.data.currentDate1 + " " + section[i]);
    }
    //sort按时间正序排序
    newSection = newSection.sort();
    maxTime = newSection[newSection.length - 1];
    minTime = newSection[0];
    //that.handleTime(maxTime, minTime)
    var val = maxTime;
    var sdate1 = new Date(val.replace(/-/g, '/'));
    sdate1.setMinutes(sdate1.getMinutes() + 30);
    var nowHours = sdate1.getHours() > 9 ? sdate1.getHours().toString() : '0' + sdate1.getHours();
    var nowMinutes = sdate1.getMinutes() > 9 ? sdate1.getMinutes().toString() : '0' + sdate1.getMinutes();
    var now = nowHours + ":" + nowMinutes;
    var endtime = that.data.currentDate1 + " " + now;
    that.setData({
      beginTime: minTime,
      endTime: endtime
    })
    that.TimeDifference(minTime, endtime);

  },
  handleTime(val, minTime) {
    var that = this;
  },
  TimeDifference(time1, time2) {
    var that = this;
    var begin1 = time1.substr(0, 10).split("-");
    var end1 = time2.substr(0, 10).split("-");
    var date1 = new Date(begin1[1] + '/' + begin1[2] + '/' + begin1[0]);
    var date2 = new Date(end1[1] + '/' + end1[2] + '/' + end1[0]);
    var m = parseInt(Math.abs(date2 - date1) / 1000 / 60);
    var min1 = parseInt(time1.substr(11, 2)) * 60 + parseInt(time1.substr(14, 2));
    var min2 = parseInt(time2.substr(11, 2)) * 60 + parseInt(time2.substr(14, 2));
    var n = min2 - min1;
    var minutes = m + n;
    var selectedTime = minutes / 60;
    var totalPrice = parseFloat(selectedTime) * parseFloat(that.data.roomPrice);
    that.setData({
      totalPrice: totalPrice
    })

  },
  judgeAction() {
    var that = this;
    var showStatus = that.data.showStatus;
    if (showStatus) { //费用详情未打开
      that.actionShow()
    } else {
      that.actionHide();
    }
  },
  actionShow: function() {
    var that = this;
    that.setData({
      showStatus: false,
    });
  },
  packBp(e) {
    this.setData({
      currenttab: e.currentTarget.dataset.index
    })
    if (e.currentTarget.dataset.index == 0) {
      this.setData({
        type: ''
      })
    }
    if (e.currentTarget.dataset.index == 1) {
      this.setData({
        type: '1'
      })
    }
    if (e.currentTarget.dataset.index == 2) {
      this.setData({
        type: '2'

      })
    }

    this.loadDatameetingorderlist();
  },
  onPullDownRefresh: function() {
    wx.stopPullDownRefresh();
    this.loadDatameetingorderlist();
    wx.showToast({
      title: '刷新成功',
      icon: 'success',
      duration: 2000
    })
  },
  enterAddserves(e) { //进入增值服务页面 选择增值服务 直接在增值服务页面下单
    var conferenceRoomId = e.currentTarget.dataset.conferenceroomid;
    var conferenceOrderId = e.currentTarget.dataset.id;
    var pageName = 'meetingOrderList'
    wx.navigateTo({
      url: '../addServes/addServes?pageName=' + pageName + '&totlaPrice=' + 0 + '&conferenceRoomId=' + conferenceRoomId + '&conferenceOrderId=' + conferenceOrderId,
    })
  },
  contract(e) { //续约
    var that = this;
    var startTime = e.currentTarget.dataset.starttime;
    var chioceDate = startTime.substring(0, 10)
    var endTime = e.currentTarget.dataset.endtime.substring(11, 16);
    var date = e.currentTarget.dataset.endtime;
    date = new Date(date.replace(/-/g, '/'));
    var weekArr = ['星期天', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
    var week = weekArr[date.getDay()];
    var chioceId = e.currentTarget.dataset.chioceid; //
    var conferenceRoomId = e.currentTarget.dataset.conferenceroomid; //
    var roomPrice = e.currentTarget.dataset.roomprice; //会议室单
    that.getTime(startTime.substring(0, 10), conferenceRoomId, startTime, endTime, roomPrice);
    that.setData({
      roomPrice: roomPrice,
      conferenceOrderId: chioceId,
      meetingEndTime: endTime,
      meetingStartTime: startTime,
      currentDate1: e.currentTarget.dataset.endtime.substring(0, 10),
      currentWeek1: week,
    })

  },
  parserDate(date) {
    var t = Date.parse(date)
    if (!isNaN(t)) {
      return new Date(Date.parse(date.replace(/-/g, '/')))
    }
  },
  goPay(e) { //直接支付
    var that = this;
    var totalAmount = e.currentTarget.dataset.totalamount;
    var totlaPrice = parseInt(totalAmount) * 100;
    var orderId = e.currentTarget.dataset.id;
    var token = app.globalData.TOKEN || wx.getStorageSync('TOKEN');
    var openId = app.globalData.openId || wx.getStorageSync('OPENID');
    wx.request({
      url: applet_park_api_url + '/api/wechatPay/conferenceOrderListPay',
      method: 'POST',
      header: {
        Authorization: token,
        'Content-Type': "application/x-www-form-urlencoded",
      },
      data: {
        totalAmount: totlaPrice, //totlaPrice
        orderId: orderId,
        openid: openId
      },
      success(res2) {
        if (res2.data.code == 0) {
          wx.requestPayment({
            timeStamp: res2.data.data.timeStamp,
            nonceStr: res2.data.data.nonceStr,
            package: res2.data.data.prepay_id,
            signType: 'MD5',
            paySign: res2.data.data.sign,
            paySource: 1,
            success(res) {

              wx.showToast({
                title: '支付成功',
              })
              setTimeout(function() { //刷新列表
                that.loadDatameetingorderlist();
              }, 500);
            },
            fail(res3) {
              
            }
          })

        } else {
          wx.showToast({
            title: '网络异常',
          })
        }
      },
      fail(res) {
        wx.showToast({
          title: res.data,
        })
      }
    })
  },
  submitPay() { //续约支付
    let that = this;
    var totlaPrice = that.data.totalPrice + '00';
    var beginTime = that.data.beginTime + ':00';
    var endTime = that.data.endTime + ':00';
    var token = app.globalData.TOKEN || wx.getStorageSync('TOKEN');
    var openId = app.globalData.openId || wx.getStorageSync('OPENID');
    wx.request({
      url: applet_park_api_url + '/api/wechatPay/conferenceRenewal',
      method: 'POST',
      header: {
        Authorization: token,
        'Content-Type': "application/x-www-form-urlencoded",
      },
      data: {
        totalAmount: totlaPrice,
        conferenceOrderId: that.data.conferenceOrderId, //会议室ID
        startTime: beginTime, //预约开始时间
        endTime: endTime, //
        openid: openId
      },
      success(res2) {
        if (res2.data.code == 0) {
          wx.requestPayment({
            timeStamp: res2.data.data.timeStamp,
            nonceStr: res2.data.data.nonceStr,
            package: res2.data.data.prepay_id,
            signType: 'MD5',
            paySign: res2.data.data.sign,
            paySource: 1,
            success(res) {

              wx.showToast({
                title: '支付成功',
              })
              setTimeout(function() { //刷新列表
                that.loadDatameetingorderlist();
              }, 500);
            },
            fail(res3) {
              
            }
          })

        } else {
          wx.showToast({
            title: '网络异常',
          })
        }
      },
      fail(res) {
        wx.showToast({
          title: res.data,
        })
      }
    })

  },
  cancleOrder(e) {
    var that = this 
    wx.request({
      url: applet_park_api_url + '/api/conferenceOrders/cancel',
      method: 'POST',
      data: {
        id: e.currentTarget.dataset.chioceid
      },
      header: {
        'Content-Type': "application/x-www-form-urlencoded"
      },
      success(res) {
        that.loadDatameetingorderlist();
        wx.showToast({
          title: res.data,
        })
      },
      fail(res) {
        wx.showToast({
          title: res.data,
        })
      }
    })
  },
  handleTime(val) {
    var that = this;
    var val = val;
    var date = val.substring(0, 10);
    var sdate1 = new Date(val);
    var now = sdate1.getTime() + 1000 * 60 * 30;
    now = new Date(now)
    now = that.formatDate(now)
    return now;
  },
  formatDate(now) {
    var date = now;
    date.getFullYear(); // 获取完整的年份(4位,1970)
    date.getMonth(); // 获取月份(0-11,0代表1月,用的时候记得加上1)
    date.getDate(); // 获取日(1-31)
    date.getTime(); // 获取时间(从1970.1.1开始的毫秒数)
    date.getHours(); // 获取小时数(0-23)
    date.getMinutes(); // 获取分钟数(0-59)
    date.getSeconds(); // 获取秒数(0-59)
    var date = new Date(now);
    Y = date.getFullYear() + '-';
    M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
    D = date.getDate() + ' ';
    h = date.getHours() + ':';
    m = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes();
    s = date.getSeconds();
    return Y + M + D + h + m;
  },
  loadDatameetingorderlist() { //获取时间列表
    let that = this;
    that.data.items = [];
    that.setData({
      items: []
    })
    var url = applet_park_api_url_imgUrl;
    requestDataparams('/api/conferenceOrders', {
      type: that.data.type
    }, 'GET').then(res => {
      if (res.data.code == 0) {
        let items = [];
        var lists = res.data.data;
        if (lists != '') {
          for (var i = 0; i < lists.length; i++) {
            if (lists[i].images) {
              var listsImg = lists[i].images.split(',')[0];
              lists[i].images = url + '/' + listsImg;
            }
            if (lists[i].appointmentStartTime) {
              lists[i].appointmentStartTime = lists[i].appointmentStartTime.substr(0, 16);
            }
            //结束时间
            if (lists[i].renewalEndTime) {
              lists[i].appointmentEndTime = lists[i].renewalEndTime.substr(0, 16);
            } else {
              if (lists[i].appointmentEndTime) {
                lists[i].appointmentEndTime = lists[i].appointmentEndTime.substr(0, 16);
              }
            }
            var isOverdue = that.judgeRenewal(lists[i].appointmentEndTime) //判断订单是否过期
            if (isOverdue) {
              lists[i]['isOverdue'] = true
            } else { //yi过期
              lists[i]['isOverdue'] = false
            }
            //价格
            var totalAmount = lists[i].totalAmount.toString();
            if (totalAmount) {
              lists[i].totalAmount = totalAmount.substring(0, totalAmount.length - 2) + '.00';
            }
          }
          that.setData({
            items: lists,
            title: ' ',
          })
        } else {
          this.setData({
            title: '暂无更多数据',
          })
        }
      }
    }).catch(err => {
      
      that.setData({
        title: '暂无更多数据',
      })
    });
  },
  judgeRenewal(time) { //判断订单是否过期
    var that = this;
    var isOverdue = true;
    time = time + ':00';
    time = new Date(time.replace(/-/g, '/'));
    time = time.getTime(time); //列表预约时间
    var date = new Date(that.data.date.replace(/-/g, '/'));
    date = date.getTime(date); //当前时间
    if ((time - date) < 0) { //已过期
      isOverdue = false;
      that.setData({
        isOverdue: false
      })
    } else {
      isOverdue = true;
      that.setData({
        isOverdue: true
      })
    }
    return isOverdue;
  },
  meetingDetail(e) {
    var conferenceRoomId = e.currentTarget.dataset.id;
    wx.navigateTo({
      url: '../MeetingDetail/MeetingDetail?conferenceRoomId=' + conferenceRoomId,
    })
  },

})